package com.wlient.basic.skill;

/**
 * @author: 史炜立
 * @description: 递归求阶乘
 * @date: 2022/7/13 17:21
 */
public class digui {

    public Integer sum(Integer n) {
        if (n == 1) {
            return n;
        } else {
            return n + sum(n - 1);
        }
    }

    public static void main(String[] args) {
        digui d = new digui();

        System.out.println( d.sum(180));
    }


}
